package com.neusoft.ysu.populationmanagement.util;

import com.neusoft.ysu.populationmanagement.entity.CommonResult;
import com.neusoft.ysu.populationmanagement.service.IIdCardService;
import com.neusoft.ysu.populationmanagement.service.IIdnumSequenceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@EnableScheduling   // 1.开启定时任务
public class IdCardSchedule {

    @Autowired
    IIdnumSequenceService idnumSequenceService;


    @Scheduled(cron = "0 0 0 * * ?")//每天的0点触发定时器重置数据表中的顺序号
    public void resetSequence(){
        CommonResult commonResult = idnumSequenceService.resetSequence();
    }

}

